home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 519 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.sprintlink.net!datalytics!news
  2. From: Rob Stewart <stew@datalytics.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Strange (to me) notation - little help?
  5. Date: 4 Jan 1996 21:35:02 GMT
  6. Organization: Datalytics, Inc
  7. Message-ID: <4chh66$ldg@gold.datalytics.com>
  8. References: <30EB32AC.2836@sierra.net>
  9. NNTP-Posting-Host: pc071.datalytics.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  14.  
  15. "Tyler G. Colwell" <snowbull@sierra.net> wrote:
  16. >I am reading Jesse Liberty's "Teach Yourself C++ in 21 Days" and have come across some notation that I can't 
  17. >find explained anywhere.  Here is a code fragment of a 
  18. [snip]
  19. > SimpleCat::SimpleCat(int age, int weight):
  20. > itsAge(age), itsWeight(weight) {}
  21. >***********************************************
  22. >
  23. >Wow, those last two lines are dumbfounding.  What is the colon at the end of that one line for, and what's up 
  24. >with using members itsAge and itsWeight as functions in the last line, and howcome none of them are inside the 
  25. >braces?
  26. >
  27.  
  28. What you're looking at is an initializer list.  There is a 
  29. thread in comp.lang.c++ discussing them.
  30.  
  31. -- 
  32. Robert Stewart        | My opinions are usually my own.
  33. Datalytics, Inc.
  34. (513)226-7700
  35. stew@datalytics.com
  36.  
  37.  
  38.